//
//  ModelVM.m
//  Demo
//
//  Created by lx on 2018/12/25.
//  Copyright © 2018 mgz. All rights reserved.
//

#import "ModelVM.h"
#import "Model.h"
#import "ModelCell.h"
@interface ModelVM ()
@property (nonatomic,strong)Model *model;
@end

@implementation ModelVM
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.inset=UIEdgeInsetsMake(10, 0, 0, 0);
        self.minimumLineSpacing=5;
        self.minimumInteritemSpacing=2;
    }
    return self;
}

- (NSInteger)numberOfItems{
    
    return 1;
}

- (CGSize)sizeForItemAtIndex:(NSInteger)index{
    return  CGSizeMake([[UIScreen mainScreen] bounds].size.width, 100);
}

- (UICollectionViewCell *)cellForItemAtIndex:(NSInteger)index{
    ModelCell *cell = [self.collectionContext dequeueReusableCellOfClass:[ModelCell class] forSectionController:self atIndex:index];
    cell.model= self.model;
    return cell;
}

- (void)didUpdateToObject:(Model *)object{
    self.model = object;
    
}
- (void)didSelectItemAtIndex:(NSInteger)index{
    
}
@end
